﻿<html>
<head>
<title>Google Dictionary - Options</title>
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<style type="text/css">
<!--
body{text-align:center;margin:0 auto;}
ul{list-style:none;}
#topLayer{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#000;color:#FFF;font-size:18px;font-weight:700;opacity:.8;z-index:999;display:none;}
#contentLayer{position:absolute;top:0;width:560px;height:100%;text-align:center;z-index:0;}
#img_close{cursor:pointer;}
#guide{background:#CADEF4;display:block;width:200px;text-align:center;margin:0 auto;}
b.guide_r{display:block;background:#fff;}
b.guide_r b{display:block;height:1px;overflow:hidden;background:#CADEF4;}
b.guide_r1{margin:0 5px;}
b.guide_r2{margin:0 3px;}
b.guide_r3{margin:0 2px;}
b.guide_r b.guide_r4{height:2px;margin:0 1px;}
#footer{margin-top:20px;border:#36C solid 1px;background-color:#E5ECF9;padding:10px inherit;}
#content{text-align:left;}
h3{font-size:18px;border-top:1px #36C solid;background-color:#E5ECF9;}
.red_link{color:red;cursor:pointer;font-size:14px;}
#save{cursor:pointer;height:30px;color:#FFF;background-color:#00F;background:url(./img/button.png);border:1px #00F solid;margin-bottom:15px;font:normal normal bold 15px/normal arial, sans-serif;padding:0 6px;}
#save:hover{background-image:none;background-color:#00F;}
-->
</style>
<script type="text/javascript">
var defaultLanguageMode = "0";
var selectedLangPairDom = null;
var lastSelectedHotKeyOptionID = "hotkeyMode_DoubleClick";
var tempSelectedShowResultID = "showResultMode_newTab";
var tempHotKeyListenKeyCode_DoubleClick = 17;
var tempHotKeyListenKeyCode_Plus = 77;
var tempHotKeyControlKeyCode = 17;//Ctrl
var tempLangPair = "en|zh-CN";
function showStatus(str) {
  var g = document.getElementById("guide");
  var status = document.getElementById("status");
  g.style.display = "block";
  status.innerHTML = str;
  setTimeout(function() {
    status.innerHTML = "";
	g.style.display = "none";
  }, 850);	
}
function showTopLayer(){
	$("#topLayer").css("display","block");
}
function hideTopLayer(){	
	document.onkeydown = null;
	$("#topLayer").css("display","none")
}
function setDefaultLanguageMode(){
	var dom = $("#defaultLanguageMode")[0];
	if(dom.checked)
	{
		defaultLanguageMode = "1";
		$("#langpair_en").attr("disabled","true");//[0].disabled = true;
		$("#langpair_zh").attr("disabled","true");//[0].disabled = true;
	}
	else
	{
		defaultLanguageMode = "0";
		$("#langpair_en").removeAttr("disabled");//[0].disabled = false;
		$("#langpair_zh").removeAttr("disabled");//[0].disabled = false;
	}	
}
function getStrFromeKeyCode(keycode){
	var str = null;
	keycode = parseInt(keycode);
	//A-65 Z-90 ctrl=17 alt=18 shift = 16
	if((keycode >= 65 && keycode <= 90) || (keycode >= 48 && keycode <= 57))
		str = String.fromCharCode(keycode);
	else
		switch(keycode)
		{
			case 16:str = "Shift";break;
			case 17:str = "Ctrl";break;
			case 18:str = "Alt";break;
			case 20:str = "Tab";break;
			case 188:str = ",";break;
			case 190:str = ".";break;
			default:str = "NotSupport!";
		}
	return str;
}
function setSelectedShowResultID(str){
/*设置翻译结果展示方式选中的值的临时变量*/
	tempSelectedShowResultID = str;
}
function changeLangPair(dom){
	tempLangPair = dom.value;
}
function save_options() {
/*保存全部选项数据，尽管有些数据无效*/
  var language = tempLangPair;
  localStorage["langpair"] = language;
  localStorage["pop_hideLangOption"] = $("#popup_hideLangOption").attr("checked");
  localStorage["optionMode"] = defaultLanguageMode;
  //是否启用热键
  if($("#hotkeyEnable")[0].checked)
	{
		localStorage["hotkeyEnable"] = "true";
		//chrome.browserAction.setBadgeText({text:"ON"});
		chrome.browserAction.setIcon({path:"./img/icon-on.png"});
	}
	else
	{
		localStorage["hotkeyEnable"] = "false";
		//chrome.browserAction.setBadgeText({text:"OFF"});
		chrome.browserAction.setIcon({path:"./img/icon-off.png"});
	}
	//热键模式
	localStorage["SelectedHotKeyOptionID"] = lastSelectedHotKeyOptionID;
	//显示结果模式
	//localStorage["SelectedShowResultRadioID"] = tempSelectedShowResultID;
	//热键码，保存全部，尽管只能有一种模式生效
	localStorage["HotKeyListenKeyCode_DoubleClick"] = tempHotKeyListenKeyCode_DoubleClick;
	localStorage["HotKeyListenKeyCode_Plus"] = tempHotKeyListenKeyCode_Plus;
	//控制热键
	localStorage["HotKeyControlKeyCode"] = tempHotKeyControlKeyCode;
  showStatus("Options Saved.");
}
function setHotkeyOption(){
/*根据是否允许热键设置所有热键选项的可用否*/
	if($("#hotkeyEnable")[0].checked)
	{
		$("input[name='showResultRadio']").each(function(){this.disabled = false});
		$("input[name='hotkeyModeRadio']").each(function(){this.disabled = false});
	}
	else
	{
		$("input[name='showResultRadio']").each(function(){this.disabled = true});
		$("input[name='hotkeyModeRadio']").each(function(){this.disabled = true});
	}
}
function restore_options() {
/*载入时恢复数据*/
  showStatus("Loading...");
  var margin_left = 0;
  margin_left = $("body").innerWidth()/2 - $("#contentLayer").outerWidth() / 2;
  $("#contentLayer").css("left", margin_left);
  var mylanguage = localStorage["mylanguage"];
  var langpair = localStorage["langpair"];
  defaultLanguageMode = localStorage["optionMode"];
  	if(!langpair)
  	{
		langpair = "en|zh-CN";
	  	localStorage["langpair"] = langpair;
  	}
	if(!localStorage["pop_hideLangOption"])
		localStorage["pop_hideLangOption"] = "true";
  if(!defaultLanguageMode)
    defaultLanguageMode = "0"
	
  if(localStorage["mylanguage"] == "zh")
  {
	  $(".lang_zh").css("display","inline");
	  $(".lang_en").css("display","none");
		selectedLangPairDom = $("#langpair_zh")[0];
		$("#lang_zh")[0].checked = true;
	}
	else
	{
	  $(".lang_en").css("display","inline");
	  $(".lang_zh").css("display","none");
		selectedLangPairDom = $("#langpair_en")[0];	
		$("#lang_en")[0].checked = true;
	}
	//恢复隐藏语言选项设置
	if(localStorage["pop_hideLangOption"] == "true")
		$("#popup_hideLangOption").attr("checked","true");
	else
		$("#popup_hideLangOption").removeAttr("checked");
  //恢复翻译方向列表选中项
  for (var i = 0; i < selectedLangPairDom.children.length; i++) {
    var child = selectedLangPairDom.children[i];
    if (child.value == langpair) {
      child.selected = "true";
      break;
    }
  }
  tempLangPair = langpair;
  
  //是否记住最后一次使用的语言方向
  if(defaultLanguageMode == "1")
  {
	document.getElementById("defaultLanguageMode").checked = true;
    $("#langpair_zh").attr("disabled","true");//[0].disabled = true;
	$("#langpair_en").attr("disabled","true");//[0].disabled = true;
  }
  else
  {
	document.getElementById("defaultLanguageMode").checked = false;
    selectedLangPairDom.disabled = false;
  }
  //热键是否可用
  if(localStorage["hotkeyEnable"] == "true")//设置热键是否可以用选框
	{
		$("#hotkeyEnable").attr("checked","true");//[0].checked = true;
	}
	else
	{
		$("#hotkeyEnable").removeAttr("checked");//[0].checked = false;
		localStorage["hotkeyEnable"] = "false";
	}
	setHotkeyOption();//设置控制选项可用否
	//新变量初始化
		//热键模式选项
  	if(!localStorage["SelectedHotKeyOptionID"])
    	localStorage["SelectedHotKeyOptionID"] = "hotkeyMode_DoubleClick";
		//结果显示选项
	//if(!localStorage["SelectedShowResultRadioID"])
   // 	localStorage["SelectedShowResultRadioID"] = "showResultMode_newTab";
		//热键码，只保存一个，因为只能有一种模式生效
	if(!localStorage["HotKeyListenKeyCode_DoubleClick"])
		localStorage["HotKeyListenKeyCode_DoubleClick"] = tempHotKeyListenKeyCode_DoubleClick;
	if(!localStorage["HotKeyListenKeyCode_Plus"])
		localStorage["HotKeyListenKeyCode_Plus"] = tempHotKeyListenKeyCode_Plus;
		//控制热键
	if(!localStorage["HotKeyControlKeyCode"])
		localStorage["HotKeyControlKeyCode"]= tempHotKeyControlKeyCode;

	//恢复保持的选项记录
	$("#"+localStorage["SelectedHotKeyOptionID"]).attr("checked","true");//热键方式选项
	//$("#"+localStorage["SelectedShowResultRadioID"]).attr("checked","true");//结果显示方式
	
	//移动结果页显示方式选项----
		//载入时是在第一个选项下面，也就是hotkeyMode_DoubleClick
	var ulHtml = $("#hotkeyMode_DoubleClick").closest("li").next("li").html();
	$("#hotkeyMode_DoubleClick").closest("li").next("li").html("");
	$("#"+localStorage["SelectedHotKeyOptionID"]).closest("li").next("li").html(ulHtml);
	lastSelectedHotKeyOptionID = localStorage["SelectedHotKeyOptionID"];
	//移动完后重设选择状态
	//$("#"+localStorage["SelectedShowResultRadioID"]).attr("checked","true");//设置结果显示方式选项
	
	//设置热键显示文字
	$("#hotkeyMode_DoubleClick_key").html(getStrFromeKeyCode(localStorage["HotKeyListenKeyCode_DoubleClick"]));
	$("#hotkeyMode_Plus_key").html(getStrFromeKeyCode(localStorage["HotKeyControlKeyCode"]) + "+" + getStrFromeKeyCode(localStorage["HotKeyListenKeyCode_Plus"]));

  showStatus("Ready.");
}
function changeLanguage(lang){
	localStorage["mylanguage"] = lang;
	if(lang == "zh")
	{
	  $(".lang_zh").css("display","inline");
	  $(".lang_en").css("display","none");
		selectedLangPairDom = $("#langpair_zh")[0];
	}
	else
	{
	  $(".lang_en").css("display","inline");
	  $(".lang_zh").css("display","none");
		selectedLangPairDom = $("#langpair_en")[0];		
	}
	for (var i = 0; i < selectedLangPairDom.children.length; i++) {
	  var child = selectedLangPairDom.children[i];
	  if (child.value == tempLangPair) {
		child.selected = "true";
		break;
	  }
	}
}
//定义热键
//A-65 Z-90 ctrl=17 alt=18 shift = 16
function setHotkey_Plus(str){
	switch(str)
	{
		case "Ctrl":tempHotKeyControlKeyCode = 17;break;
		case "Shift":tempHotKeyControlKeyCode = 16;break;
		case "Alt":tempHotKeyControlKeyCode = 18;break;
	}
	$("#setHotKey_Control").html(str+"+");
}
function setHotKeyListen_DoubleClick(){
	var keycode=event.keyCode;
	//A-65 Z-90 ctrl=17 alt=18 shift = 16
	if( (keycode >=65 && keycode <=90) || (keycode >=48 && keycode <=57) || keycode == 17 || keycode == 16)
	{
		tempHotKeyListenKeyCode_DoubleClick = keycode;
		$("#setHotKey_Listen").html(getStrFromeKeyCode(keycode));
		$("#setHotkey_PlusSubmit").removeAttr("disabled");
	}
	else
	{
		$("#setHotKey_Listen").html("Not Support!");
		$("#setHotkey_PlusSubmit").attr("disabled","true");
	}
}
function setHotKeyListen_Plus(){
	var keycode=event.keyCode;
	if( (keycode >=65 && keycode <=90) || (keycode >=48 && keycode <=57))
	{
		tempHotKeyListenKeyCode_Plus = keycode;
		$("#setHotKey_Listen").html(getStrFromeKeyCode(keycode));
		$("#setHotkey_PlusSubmit").removeAttr("disabled");
	}
	else
	{
		$("#setHotKey_Listen").html("Not Support!");
		$("#setHotkey_PlusSubmit").attr("disabled","true");
	}
}
function setHotKey_Finish(){
	//点击完成按钮，设置变量并更新页面的文字
	var hotKeyMode = $("input[name='hotkeyModeRadio']:checked").val();
	$("#hotkeyMode_DoubleClick_key").html(getStrFromeKeyCode(tempHotKeyListenKeyCode_DoubleClick));
	$("#hotkeyMode_Plus_key").html(getStrFromeKeyCode(tempHotKeyControlKeyCode) + "+" + getStrFromeKeyCode(tempHotKeyListenKeyCode_Plus));
	hideTopLayer();
}
function setHotkey(hotKeyMode){
	showTopLayer();
	$("#setHotKey_Listen").html("");
	if(hotKeyMode == "DoubleClick")
	{
		$("input[name='setHotkey_Plus']").closest("div").hide();
		$("#setHotKey_Control").hide();
		$("#hotkey_SupportKeyStr").html("A~Z 0~9 Ctrl Shift");
		document.onkeydown=function(){setHotKeyListen_DoubleClick(hotKeyMode)};
	}
	else
		if(hotKeyMode == "Plus")
		{
			$("input[name='setHotkey_Plus']").removeAttr("disabled").closest("div").show();
			$("#setHotKey_Control").show();
			$("#hotkey_SupportKeyStr").html("A~Z 0~9");
			document.onkeydown=function(){setHotKeyListen_Plus(hotKeyMode)};
		}
}
//监听
$(function(){
	$("#img_close").hover(function(){this.src="./img/close-2.png";}, function(){this.src="./img/close.png";});	
	//选项改变监听
	$("input[name='hotkeyModeRadio']").click(function(){
		//移动结果页显示方式选项----
		var ulHtml = $("#"+lastSelectedHotKeyOptionID).closest("li").next("li").html();
		$("#"+lastSelectedHotKeyOptionID).closest("li").next("li").html("");
		$(this).closest("li").next("li").html(ulHtml);
		lastSelectedHotKeyOptionID = $(this).attr("id");
		//移动结果页显示方式选项++++
		//重设选项
		$("#"+tempSelectedShowResultID)[0].checked = true;
	});
})
</script>
</head>
<body onLoad="restore_options()">
<div id="topLayer"><img id="img_close" src="img/close.png" onClick="hideTopLayer()" /><br />
  <br />
  <span class="lang_en">Pless press one key,</span><span class="lang_zh">请按下要设置的键，</span><span id="hotkey_SupportKeyStr"></span> <br />
  <div ><span id="setHotKey_Control">Ctrl+</span><span id="setHotKey_Listen"></span></div>
  <div id="setHotkey_Plus">
    <label for="setHotkey_Plus_Shift">
      <input name="setHotkey_Plus" type="radio" id="setHotkey_Plus_Shift" value="setHotkey_Plus_Shift" onClick="setHotkey_Plus('Shift')">
      Shift</label>
    <label for="setHotkey_Plus_Ctrl">
      <input name="setHotkey_Plus" type="radio" id="setHotkey_Plus_Ctrl" value="setHotkey_Plus_Ctrl" onClick="setHotkey_Plus('Ctrl')" checked>
      Ctrl</label>
    <label for="setHotkey_Plus_Alt">
      <input name="setHotkey_Plus" type="radio" id="setHotkey_Plus_Alt" value="setHotkey_Plus_Alt" onClick="setHotkey_Plus('Alt')">
      Alt</label>
  </div>
  <input name="setHotkey_PlusSubmit" id="setHotkey_PlusSubmit" onClick="setHotKey_Finish()" disabled type="button" value="Finish">
</div>
<div id="contentLayer">
<div style="height:30px;width:100%">
  <div id="guide"> <b class="guide_r"><b class="guide_r1"></b><b class="guide_r2"></b><b class="guide_r3"></b><b class="guide_r4"></b></b>
    <div id="status"></div>
    <b class="guide_r"><b class="guide_r4"></b><b class="guide_r3"></b><b class="guide_r2"></b><b class="guide_r1"></b></b> </div>
</div>
<div id="header"><img src="./img/icon_128.png" /><br />
  <label>
    <input type="radio" name="lang" id="lang_zh" value="zh" checked="checked" onClick="changeLanguage('zh')"/>
    简体中文</label>
  <label>
    <input type="radio" name="lang" id="lang_en" value="en" onClick="changeLanguage('en')"/>
    English</label>
</div>
<div id="content">
<h3><span class="lang_en">Default language option:</span><span class="lang_zh">请设置翻译语言的默认值：</span></h3>
<select name="langpair_en" id="langpair_en" class="lang_en" onChange=changeLangPair(this)>
  <option value="ar|en" >Arabic &lt;&gt; English</option>
  <option value="bn|en">Bengali &lt;&gt; English</option>
  <option value="bg|en">Bulgarian &lt;&gt; English</option>
  <option value="zh-CN|zh-CN">Chinese (Simplified) dictionary</option>
  <option value="zh-CN|en">Chinese (Simplified) &lt;&gt; English</option>
  <option value="zh-TW|zh-TW">Chinese (Traditional) dictionary</option>
  <option value="zh-TW|en">Chinese (Traditional) &lt;&gt; English</option>
  <option value="hr|en">Croatian &lt;&gt; English</option>
  <option value="cs|cs">Czech dictionary</option>
  <option value="cs|en">Czech &lt;&gt; English</option>
  <option value="nl|nl">Dutch dictionary</option>
  <option value="en|ar">English &lt;&gt; Arabic</option>
  <option value="en|bn">English &lt;&gt; Bengali</option>
  <option value="en|bg">English &lt;&gt; Bulgarian</option>
  <option selected  value="en|zh-CN">English &lt;&gt; Chinese (Simplified)</option>
  <option value="en|zh-TW">English &lt;&gt; Chinese (Traditional)</option>
  <option value="en|hr">English &lt;&gt; Croatian</option>
  <option value="en|cs">English &lt;&gt; Czech</option>
  <option value="en|en">English dictionary</option>
  <option value="en|fi">English &lt;&gt; Finnish</option>
  <option value="en|fr">English &lt;&gt; French</option>
  <option value="en|de">English &lt;&gt; German</option>
  <option value="en|el">English &lt;&gt; Greek</option>
  <option value="en|gu">English &lt;&gt; Gujarati</option>
  <option value="en|iw">English &lt;&gt; Hebrew</option>
  <option value="en|hi">English &lt;&gt; Hindi</option>
  <option value="en|it">English &lt;&gt; Italian</option>
  <option value="en|kn">English &lt;&gt; Kannada</option>
  <option value="en|ko">English &lt;&gt; Korean</option>
  <option value="en|ml">English &lt;&gt; Malayalam</option>
  <option value="en|mr">English &lt;&gt; Marathi</option>
  <option value="en|pt">English &lt;&gt; Portuguese</option>
  <option value="en|ru">English &lt;&gt; Russian</option>
  <option value="en|sr">English &lt;&gt; Serbian</option>
  <option value="en|es">English &lt;&gt; Spanish</option>
  <option value="en|ta">English &lt;&gt; Tamil</option>
  <option value="en|te">English &lt;&gt; Telugu</option>
  <option value="en|th">English &lt;&gt; Thai</option>
  <option value="fi|en">Finnish &lt;&gt; English</option>
  <option value="fr|en">French &lt;&gt; English</option>
  <option value="fr|fr">French dictionary</option>
  <option value="de|en">German &lt;&gt; English</option>
  <option value="de|de">German dictionary</option>
  <option value="el|en">Greek &lt;&gt; English</option>
  <option value="gu|en">Gujarati &lt;&gt; English</option>
  <option value="iw|en">Hebrew &lt;&gt; English</option>
  <option value="hi|en">Hindi &lt;&gt; English</option>
  <option value="it|en">Italian &lt;&gt; English</option>
  <option value="it|it">Italian dictionary</option>
  <option value="kn|en">Kannada &lt;&gt; English</option>
  <option value="ko|en">Korean &lt;&gt; English</option>
  <option value="ko|ko">Korean dictionary</option>
  <option value="ml|en">Malayalam &lt;&gt; English</option>
  <option value="mr|en">Marathi &lt;&gt; English</option>
  <option value="pt|en">Portuguese &lt;&gt; English</option>
  <option value="pt|pt">Portuguese dictionary</option>
  <option value="ru|en">Russian &lt;&gt; English</option>
  <option value="ru|ru">Russian dictionary</option>
  <option value="sr|en">Serbian &lt;&gt; English</option>
  <option value="es|en">Spanish &lt;&gt; English</option>
  <option value="es|es">Spanish dictionary</option>
  <option value="ta|en">Tamil &lt;&gt; English</option>
  <option value="te|en">Telugu &lt;&gt; English</option>
  <option value="th|en">Thai &lt;&gt; English</option>
</select>
<select name="langpair_zh" id="langpair_zh" class="lang_zh" onChange=changeLangPair(this)>
  <option value="ar|en">阿拉伯语 &lt;&gt; 英语</option>
  <option value="bg|en">保加利亚语 &lt;&gt; 英语</option>
  <option value="de|de">德语字典</option>
  <option value="de|en">德语 &lt;&gt; 英语</option>
  <option value="ru|ru">俄语字典</option>
  <option value="ru|en">俄语 &lt;&gt; 英语</option>
  <option value="fr|fr">法语字典</option>
  <option value="fr|en">法语 &lt;&gt; 英语</option>
  <option value="fi|en">芬兰语 &lt;&gt; 英语</option>
  <option value="gu|en">古吉拉特语 &lt;&gt; 英语</option>
  <option value="ko|ko">韩语字典</option>
  <option value="ko|en">韩语 &lt;&gt; 英语</option>
  <option value="nl|nl">荷兰语字典</option>
  <option value="cs|cs">捷克语字典</option>
  <option value="cs|en">捷克语 &lt;&gt; 英语</option>
  <option value="hr|en">克罗地亚语 &lt;&gt; 英语</option>
  <option value="bn|en">孟加拉语 &lt;&gt; 英语</option>
  <option value="pt|pt">葡萄牙语字典</option>
  <option value="pt|en">葡萄牙语 &lt;&gt; 英语</option>
  <option value="sr|en">塞尔维亚语 &lt;&gt; 英语</option>
  <option value="th|en">泰语 &lt;&gt; 英语</option>
  <option value="es|es">西班牙语字典</option>
  <option value="es|en">西班牙语 &lt;&gt; 英语</option>
  <option value="iw|en">希伯来语 &lt;&gt; 英语</option>
  <option value="el|en">希腊语 &lt;&gt; 英语</option>
  <option value="it|it">意大利语字典</option>
  <option value="it|en">意大利语 &lt;&gt; 英语</option>
  <option value="hi|en">印地语 &lt;&gt; 英语</option>
  <option value="kn|en">印度的卡纳达语 &lt;&gt; 英语</option>
  <option value="mr|en">印度的马拉地语 &lt;&gt; 英语</option>
  <option value="ml|en">印度的马拉雅拉姆语 &lt;&gt; 英语</option>
  <option value="te|en">印度的泰卢固语 &lt;&gt; 英语</option>
  <option value="ta|en">印度的泰米尔语 &lt;&gt; 英语</option>
  <option value="en|ar">英语 &lt;&gt; 阿拉伯语</option>
  <option value="en|bg">英语 &lt;&gt; 保加利亚语</option>
  <option value="en|de">英语 &lt;&gt; 德语</option>
  <option value="en|ru">英语 &lt;&gt; 俄语</option>
  <option value="en|fr">英语 &lt;&gt; 法语</option>
  <option value="en|fi">英语 &lt;&gt; 芬兰语</option>
  <option value="en|gu">英语 &lt;&gt; 古吉拉特语</option>
  <option value="en|ko">英语 &lt;&gt; 韩语</option>
  <option value="en|cs">英语 &lt;&gt; 捷克语</option>
  <option value="en|hr">英语 &lt;&gt; 克罗地亚语</option>
  <option value="en|bn">英语 &lt;&gt; 孟加拉语</option>
  <option value="en|pt">英语 &lt;&gt; 葡萄牙语</option>
  <option value="en|sr">英语 &lt;&gt; 塞尔维亚语</option>
  <option value="en|th">英语 &lt;&gt; 泰语</option>
  <option value="en|es">英语 &lt;&gt; 西班牙语</option>
  <option value="en|iw">英语 &lt;&gt; 希伯来语</option>
  <option value="en|el">英语 &lt;&gt; 希腊语</option>
  <option value="en|it">英语 &lt;&gt; 意大利语</option>
  <option value="en|hi">英语 &lt;&gt; 印地语</option>
  <option value="en|kn">英语 &lt;&gt; 印度的卡纳达语</option>
  <option value="en|mr">英语 &lt;&gt; 印度的马拉地语</option>
  <option value="en|ml">英语 &lt;&gt; 印度的马拉雅拉姆语</option>
  <option value="en|te">英语 &lt;&gt; 印度的泰卢固语</option>
  <option value="en|ta">英语 &lt;&gt; 印度的泰米尔语</option>
  <option value="en|en">英语字典</option>
  <option value="en|zh-TW">英语 &lt;&gt; 中文(繁体)</option>
  <option selected  value="en|zh-CN">英语 &lt;&gt; 中文(简体)</option>
  <option value="zh-TW|en">中文(繁体) &lt;&gt; 英语</option>
  <option value="zh-TW|zh-TW">中文(繁体)字典</option>
  <option value="zh-CN|en">中文(简体) &lt;&gt; 英语</option>
  <option value="zh-CN|zh-CN">中文(简体)字典</option>
</select>
<br />
<input name="defaultLanguageMode" id="defaultLanguageMode" type="checkbox" value="1" onChange="setDefaultLanguageMode()">
<label for="defaultLanguageMode"><span class="lang_en">Remember the latest search</span><span class="lang_zh">记住最后一次的翻译语言</span></label>
<br />
<br />
<h3><span class="lang_en">Popup Window:</span><span class="lang_zh">搜索窗口设置：</span></h3>
<label for="popup_hideLangOption">
  <input name="popup_hideLangOption" id="popup_hideLangOption" type="checkbox" value="popup_hideLangOption">
  <span class="lang_en">Hide language option.</span><span class="lang_zh">隐藏搜索窗口的语言选项</span></label>
<h3><span class="lang_en">Hot key support:</span><span class="lang_zh">快捷键</span></h3>
<label for="hotkeyEnable">
  <input name="hotkeyEnable" id="hotkeyEnable" type="checkbox" value="hotkeyEnable" onChange="setHotkeyOption()">
  <span class="lang_en">Enable</span><span class="lang_zh">使用</span></label>
<br />
<ul>
<li class="c_hotkeyModeRadio">
  <label for="hotkeyMode_DoubleClick">
    <input name="hotkeyModeRadio" type="radio" id="hotkeyMode_DoubleClick" value="hotkeyMode_DoubleClick" checked disabled>
    <span class="lang_en">Double press&nbsp;</span><span class="lang_zh">双击</span><span class="red_link" id="hotkeyMode_DoubleClick_key" onClick="setHotkey('DoubleClick')">Ctrl</span><span class="lang_zh">键</span><span class="red_link" onClick="setHotkey('DoubleClick')">[<span class="lang_en">Set</span><span class="lang_zh">设置</span>]</span>:</label>
</li>
<li class="c_showResultRadio">
  <ul>
    <li>
      <label for="showResultMode_newTab">
        <input name="showResultRadio" type="radio" id="showResultMode_newTab" value="showResultMode_newTab" onClick="setSelectedShowResultID('showResultMode_newTab')" checked disabled>
        <span class="lang_en">Search the selected word and show result in new tab.</span><span class="lang_zh">翻译选中的单词，并在新的标签里打开翻译结果</span></label>
    </li>
    <li><!--
      <label for="showResultMode_Frame">
        <input name="showResultRadio" type="radio" id="showResultMode_Frame" value="showResultMode_Frame" onClick="setSelectedShowResultID('showResultMode_Frame')"  disabled>
        <span class="lang_en">Search the selected word and show result in a frame.</span><span class="lang_zh">翻译选中的单词，并在浮动在本页的小窗口里显示</span></label>
        -->
    </li>
  </ul>
</li>
<li class="c_hotkeyModeRadio">
  <label for="hotkeyMode_Plus">
    <input name="hotkeyModeRadio" type="radio" id="hotkeyMode_Plus" value="hotkeyMode_Plus" disabled>
    <span class="lang_en">Use </span><span class="lang_zh">使用组合键</span><span class="red_link" id="hotkeyMode_Plus_key" onClick="setHotkey('Plus')">Shift+C</span><span class="red_link" onClick="setHotkey('Plus')">[<span class="lang_en">Set</span><span class="lang_zh">设置</span>]</span>：</label>
</li>
<li class="c_showResultRadio"> </li>
<br />
<br />
<button onClick="save_options()" id="save"><span class="lang_en">Save</span><span class="lang_zh">保存</span></button>
</div>
<div id="footer"><span class="lang_en"> Bugs or suggestions please email <a href="mailto:im007boy@gmail.com">im007boy@gmail.com</a>.I am Chinese. </span><span class="lang_zh">发现错误或有任何建议请与我联系，<a href="mailto:im007boy@gmail.com">im007boy@gmail.com</a>。谢谢使用。</span></div>
</div>
</body>
</html>